package com.lgx.right.dao;

import java.util.List;

import com.lgx.common.exception.DataException;
import com.lgx.common.web.Pagination;
import com.lgx.right.entity.User;

/**
 * 
 * @author acer
 *
 */
public interface IUserDao  {
	public User createUser(User user) throws DataException;
	public User updateUser(User user) throws DataException;
	public void deleteUser(User user) throws DataException;
	public void deleteUserById(long id) throws DataException;
	public User findUserById(long id);
	public List<User> findUserList(String sql);
	public List<User> findUserList(String name, String param);    
	public User loginUser(String username,String password);  
	public List<User> findUserList(String sql,Object[] params, int pageSize,int pageNum);
	public Pagination findUserPagination(String sql,Object[] params, int pageSize,int pageNum);
	public Pagination findUserPagination(Object[] params, Class<?> clazz, int pageSize,int pageNum);
	public List<User> findActiveUserList(long num);
	
	/**
	 * 
	 * 查询用户信息
	 * name:若name不为空，则根据 username 做模糊查询
	 * card:若card不为空，则根据card做模糊查询
	 * mobile：若mobile不为空，则根据mobile做模糊查询
	 * registerTimeStar与registerTimeEnd：若registerTimeStar与registerTimeEnd不为空，则根据registerTimeStar和registerTimeEnd做范围查询
	 *
	 * @param type
	 * @param orgId
	 * @param usertype
	 * @param name
	 * @param card
	 * @param mobile
	 * @param registerTimeStar
	 * @param registerTimeEnd
	 * @param orgName
	 * @param pageSize
	 * @param pageNum
	 * @return
	 */
	public Pagination findUserList(String type,long orgId,int usertype,String name,String card,String mobile,
			String registerTimeStar, String registerTimeEnd ,String orgName,String isMaster,int pageSize,int pageNum);
	
}
